<template>
  <transition :name="transitionName">
    <router-view class="login-view"></router-view>
  </transition>
</template>

<script>
export default {
  name: 'login',
  data() {
    return {
      transitionName: 'slide-left',
    }
  },
  watch: {
    $route(to, from) {
      const toDepth = to.path.split('/').length
      const fromDepth = from.path.split('/').length
      this.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
    },
  },
}
</script>

<style lang="scss">
.login-view {
  position: absolute;
  width: 100%;
  top: 0;
  transition: transform .3s ease-out;
}

.login-content {
  padding-left: 30px;
  padding-right: 30px;
  text-align: center;
  .login-ideograph {
    display: block;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
  }
  .login-label {
    display: block;
    font-size: 16px;
    margin-bottom: 16px;
  }
}
</style>
